/*
 * Project: JDiveLog: A Dive Logbook written in Java
 * File: Tank.java
 * 
 * @author Pascal Pellmont <jdivelog@pellmont.dyndns.org>
 * 
 * This file is part of JDiveLog.
 * JDiveLog is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.

 * JDiveLog is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with JDiveLog; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
package scubalogbook.data.imports.jdivelog.model;

import scubalogbook.data.imports.jdivelog.model.udcf.Gas;
import scubalogbook.data.imports.jdivelog.util.XmlTextEncodingUtil;

/**
 * Description: Tank information ; less precise than the Gas class
 * 
 * @author Pascal Pellmont <jdivelog@pellmont.dyndns.org>
 */
public class Tank {
    
    /** Tanktype (Steel, Aluminium, Carbon, ...) */
    private String type;
    
    /** Gas in the Tank */
    private Gas gas;
    
    public String toString() {
        StringBuffer sb = new StringBuffer("<Tank>");
        sb.append("<Type>");
        if (type != null) sb.append(XmlTextEncodingUtil.xmlEntityConvert(type));
        sb.append("</Type>");
        if (gas != null) sb.append(gas);
        sb.append("</Tank>");
        return sb.toString();
    }

    public Gas getGas() {
        return gas;
    }
    public void setGas(Gas gas) {
        this.gas = gas;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public Tank deepClone() {
        Tank t = new Tank();
        t.type = type;
        t.gas = gas.deepClone();
        return t;
    }
}
